//
//  ClassifyCollectionReusableView.m
//  MyNewProject
//
//  Created by 王春辉 on 2019/12/21.
//  Copyright © 2019年 sun. All rights reserved.
//

#import "ClassifyCollectionReusableView.h"

@interface ClassifyCollectionReusableView()
@property (nonatomic, strong) UIView *lineView;
@end
@implementation ClassifyCollectionReusableView
@synthesize titleLabel = _titleLabel;

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setupContentViews];
    }
    return self;
}
- (UIView *)lineView {
    if (!_lineView) {
        self.lineView = [[UIView alloc] initWithFrame:CGRectZero];
        _lineView.backgroundColor = SKColorWithHex(0xE5E5E5);
        [self addSubview:_lineView];
    }
    return _lineView;
}
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.backgroundColor = [UIColor whiteColor];
        _titleLabel.textColor = SKColorWithHex(0xB1B1B1);
        _titleLabel.font = SKFONT_SIZE(13);
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:_titleLabel];
    }
    return _titleLabel;
}

- (void)setupContentViews {
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(32);
        make.height.mas_equalTo(0.5);
        make.center.mas_offset(0);
    }];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_offset(0);
        make.left.mas_equalTo(self.lineView.mas_left).mas_offset(50);
    }];
}
@end
